package com.shell.governor.util;

import com.shell.framework.kernel.context.ContextCache;
import java.util.Map;

public class ConstantsUtil {
	public static Map<String, Map<String, String>> constantsCnNameValueMap = null;

	public static Map<String, String> getConstantsValueMap(String parentConstants, String subConstants) {
		Map<String, Object> context = ContextCache.getValue(ContextCache.CACHE_CONTEXT_KEY);
		Map<String, Map<String, Object>> constantsValueMap = (Map) context.get("constantsValueMap");

		return (Map) ((Map) constantsValueMap.get(parentConstants)).get(subConstants);
	}

	public static Map<String, String> getConstantsNameValueMap(String parentConstants, String subConstants) {
		Map<String, Object> context = ContextCache.getValue(ContextCache.CACHE_CONTEXT_KEY);
		Map<String, Map<String, Object>> constantsNameValueMap = (Map) context.get("constantsNameValueMap");
		return (Map) ((Map) constantsNameValueMap.get(parentConstants)).get(subConstants);
	}
}
